import axios from 'axios';

// 删除角色
let remove = (role_id, params) => axios.delete(`/role/${role_id}`, { params });

// 更新角色
let update = (role_id, data) => axios.put(`/role/${role_id}`, data);

// 根据角色id，获取菜单、操作权限
let menu_power = (params) => axios.get('/role/menu/', { params });

// 根据角色id，获取路由权限
let route_power = (params) => axios.get('/role/route/', { params });

// 添加角色
let add = (data) => axios.post('/role', data);

// 获取角色列表
let list = (params) => axios.get('/role/list', { params });

// 配置角色--菜单权限，操作权限
let set_menu_power = (data) => axios.post('/role/menu', data);

//  配置角色--路由权限
let set_route_power = (data) => axios.post('/role/route', data);

// 让函数能在别的页面用，要export
export default {
	remove,
	update,
	menu_power,
	set_menu_power,
	add,
	list,
	route_power,
	set_route_power,
}
